const md = require('../../utils/md5.js');
const app = getApp();
const post = require('../../utils/post.js');
var WxParse = require('../../wxParse/wxParse.js');
Page({

  data: {
  
  },

  onLoad: function (options) {
    var that = this;
    var data = {};
    data.where = "ProtocolID = 1";
    console.log(data);
    var url = "/BO/AP_Protocol/Query";
    var callback = function (res) {
      console.log(res);
      if (res.data.data != '') {
        var article = res.data.data[0].Content;
        article = article.replace(/<o:p>/g, '');
        article = article.replace(/<\/o:p>/g,'');
        WxParse.wxParse('article', 'html', article, that, 5);
        // article = article.replace(regexp / substr, replacement)
        that.setData({
          content: article
        })
      } else {
        wx.showModal({
          title: '',
          content: res.data.msg,
        })
        return;
      }
    };
    var res = post.getdata(url, data, callback);
  },
  beagree:function(){
    wx.setStorageSync('auth', 1);
    wx.navigateBack({
      delta:1
    })
  }
})